// address.js
var ajax = require("../../utils/network.js");

Page({

  /**
   * 页面的初始数据
   */
  data: {
    addressList:[],
    hidden: true
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },
  onShow: function(){
    this.addrress();
  },

  // 获取地址列表
  addrress: function(){
    var that = this;
    var token = wx.getStorageSync("token");
    var URL = ajax.server() + 'member/info-api?token=' + token;
    var Params = {};
    var Method = 'GET';
    var Message = '';
    ajax.requestLoading(URL, Params, Method, Message, function (res) {
      console.log('用户信息---', res)
      if (res.code == 0) {
        var areainfo = res.data.areainfo;
        that.setData({
          areainfo: areainfo
        })
      }
    }, function () { })
  },

  loginOut: function(){
    wx.navigateTo({
      url: '../addAddress/addAddress',
    })
  }
})